import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';

import { Observable } from 'rxjs';
import { Customer2Service } from "../../../shared/services/product2/customer.service";

@Injectable()
export class CustomerResolver implements Resolve<Observable<any>> {

    constructor(private customerService: Customer2Service){
    }

    resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<any>| any {
         return this.customerService.getOne(route.params["id"]);
    }
}
